Get the first and last 4th elements of a TupleΒΆ
Get the 4th element and 4th element from last of a tuple.
#Get an item of the tuple
T = ("w", 3, "r", "e", "s", "o", "u", "r", "c", "e")
print(T) # ('w', 3, 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e')
#Get item (4th element)of the tuple by index
t = T[3]
print(t) # e
#Get item (4th element from last)by index negative
t = T[-4]
print(t) # u